<template id="huodong">
    <div class="share_m">
        <div class="shop_detail"><img @click="get_back()" src="/dist/blue_da.png?7b253c3a49e763079c0e4911300b30ce" alt=""> <h4>{{data.title}}</h4></div>
        <div class="cl"></div>
        <div class="" v-html="data.text" id="huo"></div>
    </div>

</template>

<script>
    export default {
        name:'huodong',
        data(){
            return{
                id:this.$route.query.id,
                data:'',
            }
        },
     
        mounted:function(){
            if(!this.id){
               window.history.go(-1);
               return;
            }
              //获取资金记录
            let info   = [];
            info['c']  = 'Activity';
            info['m']  = 'huodong';
            info['id'] = this.id;
            info['back_url']  = encodeURI(location.href.split('#')[0]);
            this.getApi(info);

/*
          */

        },
        methods:{
            getApi:function(data){
                let url  = this.GLOBAL.BaseUrl+'/mobile/api/index.php';
                let Data = this.GLOBAL.dataParam(data);

                this.$ajax.post(url,Data).then((res) => {
                    let temp = res.data;
                    if(temp.code == 200){
                        this.data = temp.data;     
   
                        let info = [];
                        info['title']   = temp.data.title;
                        info['desc']    = temp.data.notes;
                        info['imgUrl']  = temp.data.img;
                        info['link']    = temp.data.link;

                        if(init.isWeiXin()){
                            var arr    = [];
                            arr['url'] = encodeURI(location.href.split('#')[0]);

                            share.share_init(arr);
                            share.share_wx(info);
                        }else{
                           share.share_web(info);
                        }

                    }else{
                       this.GLOBAL.center_error(this,temp);        
                    }  
                })     
            },
            get_back:function(){
                window.history.go(-1);
            }
        },
       
    }
		
    
</script>
<style>
    #huo p{
        width:100%;
	line-height:10px!important;
	margin: 0 auto;
    }
    #huo p img{
        width: 100%;
        display:block;
    }
    .shop_detail{
        width: 100%;
        height: 48px;
        background-color: #FFFFFF;
        font-size: 14px;
        position: fixed;
        top: 0;
        z-index: 3;
    }
    .cl{
        width: 100%;
        height: 48px;
    }
    .shop_detail img{
        height:0.36rem;
        width:0.36rem;
        display:block;
        position:absolute;
        left:0.25rem;
        top:0.2rem;
    }
    .shop_detail h4{
        height:0.79rem;
        color:#2eaffc;
        font-size:0.28rem;
        line-height:0.79rem;
        text-align:center;
        /*font-weight:normal;*/
    }
</style>
